package com.mtsmda.designPattern.buider;

public class Computer {

	private String ram;
	private String cpu;

	private boolean graphicsCardEnabled;
	private boolean bluetoothEnabled;

	public String getRam() {
		return ram;
	}

	public void setRam(String ram) {
		this.ram = ram;
	}

	public String getCpu() {
		return cpu;
	}

	public void setCpu(String cpu) {
		this.cpu = cpu;
	}

	public boolean isGraphicsCardEnabled() {
		return graphicsCardEnabled;
	}

	public void setGraphicsCardEnabled(boolean isGraphicsCardEnabled) {
		this.graphicsCardEnabled = isGraphicsCardEnabled;
	}

	public boolean isBluetoothEnabled() {
		return bluetoothEnabled;
	}

	public void setBluetoothEnabled(boolean isBluetoothEnabled) {
		this.bluetoothEnabled = isBluetoothEnabled;
	}

	private Computer(ComputerBuilder computerBuilder) {
		this.bluetoothEnabled = computerBuilder.bluetoothEnabled;
		this.graphicsCardEnabled = computerBuilder.graphicsCardEnabled;
		this.cpu = computerBuilder.cpu;
		this.ram = computerBuilder.ram;
	}

	public static class ComputerBuilder {
		private String ram;
		private String cpu;

		private boolean graphicsCardEnabled;
		private boolean bluetoothEnabled;

		public ComputerBuilder(String ram, String cpu) {
			this.ram = ram;
			this.cpu = cpu;
		}

		public ComputerBuilder setGraphicsCardEnabled(
				boolean isGraphicsCardEnabled) {
			this.graphicsCardEnabled = isGraphicsCardEnabled;
			return this;
		}

		public ComputerBuilder setBluetoothEnabled(boolean isBluetoothEnabled) {
			this.bluetoothEnabled = isBluetoothEnabled;
			return this;
		}
		
		public Computer build(){
			return new Computer(this);
		}
	}

}